<?php

namespace backend\controllers;


use app\models\Askfor;
use Yii;
use yii\db\mssql\PDO;
use yii\db\Query;
use yii\web\Controller;


/**
 * Customer controller
 * 客户管理
 */
class CustomerController extends Controller
{
    public $enableCsrfValidation = false;

    //查看详情
    public function actionDetail()
    {
        $post = Yii::$app->request->post();
        $model = new Askfor();
        $res = $model->userinfo($post);
        return json_encode(['code' => 200, 'message' => 'ok', 'data' => $res]);
    }

    //审批通过
    public function actionApproved()
    {
        $post = Yii::$app->request->post();
        $model = new Askfor();
        $res = $model->getpast($post);
        return json_encode(['code' => 200, 'message' => 'ok', 'data' => $res]);
    }
    
    //审批不通过
    public function actionApprovalfailed()
    {
        $post = Yii::$app->request->post();
        $model = new Askfor();
        $res = $model->getfailed($post);
        return json_encode(['code' => 401, 'message' => 'ok', 'data' => $res]);
    }


}
